<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- <a href="http://127.0.0.1/index.html">跳转nginx</a>
    <form action="" method="method"></form> -->
    <script>
        // 访问后端的对象
        let xhr = new XMLHttpRequest()

        // 设置访问路径
        xhr.open('GET','http://192.168.134.3:4000/query?wd=淘宝&age=10')
        
        // 发送信息
        xhr.send()
        // 监听相应状态
        xhr.onreadystatechange = function () {
            console.log(xhr.readyState);
            if (xhr.readyState==0) {
                console.log('UNSENT:初始状态');
            }
            if (xhr.readyState==1) {
                console.log('OPENED:打开方法执行');
            }
            if (this.readyState == 4 &&this.status ==200) {
                console.log(this.responseText);
            }
        }
    </script>
</body>
</html>